Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
@opentelemetry/resource-detector-gcp
Advanced tools
OpenTelemetry SDK resource detector for GCP
Resource detector for Google Cloud Platform.
Compatible with OpenTelemetry JS API and SDK 1.0+
.
The GCP resource detector requires Node.JS 10+ due to a dependency on gcp-metadata
which uses features only available in Node.JS 10+.
npm install --save @opentelemetry/resource-detector-gcp
import { detectResources } from '@opentelemetry/resources';
import { gcpDetector } from '@opentelemetry/resource-detector-gcp'
const resource = await detectResources({
detectors: [gcpDetector],
})
const tracerProvider = new NodeTracerProvider({ resource });
This package uses @opentelemetry/semantic-conventions
version 1.22+
, which implements Semantic Convention Version 1.7.0
Resource Attribute | Description |
---|---|
cloud.account.id | Value of project-id from GCP Metadata project |
cloud.availability_zone | Value of zone from GCP Metadata instance |
cloud.provider | The cloud provider. In this context, it's always "gcp" |
container.name | Value of Environment Variable CONTAINER_NAME |
host.id | Value of id from GCP Metadata instance |
host.name | Value of hostname from GCP Metadata instance |
k8s.cluster.name | Value of attributes/cluster-name from GCP Metadata instance |
k8s.namespace.name | Value of Environment Variable NAMESPACE |
k8s.pod.name | Value of Environment Variable HOSTNAME |
Apache 2.0 - See LICENSE for more information.
FAQs
OpenTelemetry SDK resource detector for GCP
The npm package @opentelemetry/resource-detector-gcp receives a total of 661,720 weekly downloads. As such, @opentelemetry/resource-detector-gcp popularity was classified as popular.
We found that @opentelemetry/resource-detector-gcp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.